import {createBrowserRouter} from 'react-router-dom'
// 懒加载
import { Children, lazy } from 'react'
// 一级
import Login from '../pages/login/Index'
import Error from '../pages/404/Index'
import Layout from '../pages/layout/Index'
import { AntOutline } from 'antd-mobile-icons'
// 二级
let Home=lazy(()=>import('../pages/home/Index'))

export let childroutes=[
    {
        path:'/',
        element:<Home></Home>,
        title:'首页',
        icon:<AntOutline/>
    }
]

let routes =createBrowserRouter([
    {
        path:'/',
        element:<Layout></Layout>,
        children:childroutes
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'*',
        element:<Error></Error>
    }
])

export default routes